<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
 
</head>
<body>
  <div id="app">
    <ul>
      <li v-for="cate in cates" :key="cate.id">
        <img :src="cate.icon" alt="">
        <h3>{{cate.name}}</h3>
      </li>
    </ul>
  </div>
  <script src="./vue.js"></script>
  <script src="./axios.js"></script>
  <script>
    // https://api.it120.cc
    const vm = new Vue({
      el: '#app',
      data:{
       cates: [],
      },
      created(){
        this.fetchCates();
      },
      methods: {
        fetchCates(){
          axios.get('https://api.it120.cc/conner/shop/goods/category/all',{
            params: {
              page: 1,
              pageSize: 10
            }
          }).then(res=> {
            console.log(res);
            if(res.data.code === 0) {
              this.cates = res.data.data
            }
          })
        }
      }
    })
  </script>
</body>
</html>